package cn.driver.reserve.tools;

import io.swagger.annotations.ApiModelProperty;

public class Page {
    @ApiModelProperty("返回数据")
    Object data;
    @ApiModelProperty("当前页数")
    private int pageIndex;
    @ApiModelProperty("数据总数")
    private int dataCount;
    @ApiModelProperty("总页数")
    private int pageCount;

    public Page(int pageIndex, int pageSize, int dataCount, Object data) {
        this.pageIndex = pageIndex;
        this.dataCount = dataCount;
        this.pageCount = dataCount % pageSize == 0 ? dataCount / pageSize : dataCount / pageSize + 1;
        this.data = data;
    }


    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getDataCount() {
        return dataCount;
    }

    public void setDataCount(int dataCount) {
        this.dataCount = dataCount;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
